import { httpTwo } from '@/utils/http/axios';
import qs from 'qs';

// 历史账单列表
export function getHistoryBillList(params) {
  return httpTwo.request({
    url: '/bill/cakeList',
    method: 'POST',
    params,
  });
}

// 账单撤回
export function hideBillItem(params) {
  return httpTwo.request({
    url: '/bill/hide?' + qs.stringify(params),
    method: 'POST',
    params,
  });
}

// 账单下载
export function downloadBill(params) {
  const { billCode, billType } = params;
  return httpTwo.request(
    {
      url: `/bill/download/${billCode}?billType=${billType}`,
      method: 'POST',
      params,
      responseType: 'blob',
    },
    { breakTransformRequsetData: true },
  );
}
